<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

<h:head></h:head> 
<h:body> 
	<h:form>
		<h:panelGrid columns="3">
			<h:outputLabel value="Nome" />
			<h:inputText value="#{fornecedorManagedBean.fornecedor.nome}" required="true" requiredMessage="Informe o nome!"
						 id="fornecedoNomeCadastro" validatorMessage="Tamanho mínimo deve ser 5 e o máximo deve ser 30">
				<f:validateLength for="fornecedoNomeCadastro" minimum="5"  maximum="30"/>
			</h:inputText>
			<h:message for="fornecedoNomeCadastro"/>
			<h:outputLabel value="CNPJ" />
			<h:inputText value="#{fornecedorManagedBean.fornecedor.cnpj}" required="true" requiredMessage="Informe o cnjp!"
						 id="fornecedoCNPJCadastro" validatorMessage="CNPJ deve ter 14 dígitos">
				<f:validateLength for="fornecedoCNPJCadastro" minimum="14"  maximum="14"/>
			</h:inputText>
			<h:message for="fornecedoCNPJCadastro"/>
		</h:panelGrid>
		<h:commandButton value="Cadastrar" action="#{fornecedorManagedBean.salvar}" />
		<h:commandButton value="Voltar" action="index"  immediate="true"/>
	</h:form>
</h:body> 
</html>
